package com.yang.handler;

import com.yang.domain.User;

/**
 * @Author: 不是菜鸡爱编程
 * @Date: 2024/02/17/12:18
 * @Description:
 */
public class UserThreadLocal {
    private UserThreadLocal(){}
    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    public static void put(User user){
        LOCAL.set(user);
    }

    public static User get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}
